/*
 * This file is part of Ember.
 *
 * Ember is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Ember is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Ember.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Copyright (C) Grant Tyra 2010
 * granttyra@gmail.com
*/

#ifndef EMBER_STATEMENT_H_
#define EMBER_STATEMENT_H_

#include "ember_list.h"

#define STATEMENT_ROOT 0
#define STATEMENT_ASSIGN 1
#define STATEMENT_CALL 2
#define STATEMENT_VALUE 3
#define STATEMENT_NEW 4
#define STATEMENT_IF 5
#define STATEMENT_FOR 6
#define STATEMENT_WHILE 7
#define STATEMENT_RETURN 8
#define STATEMENT_STATIC 9
#define STATEMENT_LIST 10
#define STATEMENT_RAW 11
#define STATEMENT_DICT 12
#define STATEMENT_BREAK 13
#define STATEMENT_CONTINUE 14
#define STATEMENT_FOREACH 15

typedef struct statement_s {
    void *subs;
	char *code;
    int type;
} EmberStatement;

EMBER_EXPORT EmberStatement *statement_create(int);
EMBER_EXPORT char *statement_build_root(EmberStatement**, EmberList*, int, int, int*);
EMBER_EXPORT char *statement_build_single(EmberStatement**, const char*);
EMBER_EXPORT int statement_sub_count(EmberStatement*);
EMBER_EXPORT void *statement_sub(EmberStatement*, int);
EMBER_EXPORT void *statement_raw(EmberStatement*);
EMBER_EXPORT void statement_destroy(EmberStatement*);

#endif
